{% extends "@EasyWorkflow/base.html.twig" %}
{% block content %}
    <!-- content -->
    <div class="col-md-10">
        <div class="row">
            <div class="col-lg-12">
                <div class="page-header">
                    <h1>文件上传测试</h1>
                </div>
            </div>
        </div>
        {% include '@EasyWorkflow/_flash_messages.html.twig' %}
        <div class="row">
            <div class="col-lg-12">
                <div class="panel panel-default">
                    <div class="panel-heading">
                        <div class="text-muted bootstrap-admin-box-title">文件上传</div>
                    </div>
                    <div class="bootstrap-admin-panel-content text-muted" style="padding: 60px 0;">
                        <div class="row">
                            <div class="col-md-6 col-md-offset-3">
                                <form action="{{ path('easyworkflow_files_upload2mongo') }}" method="post"
                                      enctype="multipart/form-data">
                                    <div class="form-group">
                                        <label for="file"><span class="text-danger">*</span> 文件上传</label>
                                        <input type="file" name="file" id="file"/>
                                    </div>
                                    <div class="form-group">
                                        <label for="file"><span class="text-danger">*</span> 粘贴上传</label>
                                        <textarea id="pasteUpload" class="form-control" cols="30" rows="10"></textarea>
                                    </div>
                                    <button type="submit" class="btn btn-primary btn-sm"><i
                                                class="glyphicon glyphicon-hand-up"></i> 确定提交
                                    </button>
                                </form>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
{% endblock %}
{% block javascripts %}
    {{ parent() }}
    <script type="text/javascript">
    $(function () {
        $('#pasteUpload').inlineattachment({
            uploadUrl: '{{ path('easyworkflow_files_upload2mongo') }}?isPasteUpload=1',
            urlText: function (filename, result) {
                return filename;
            }
        });
    });
    </script>
{% endblock %}
